package com.yzjs.localhost.controller.tNeusoftResourceDictionary;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.yzjs.common.enumeration.RequestMethod;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import com.yzjs.common.base.entity.PageInfo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yzjs.localhost.entity.tNeusoftResourceDictionary.TNeusoftResourceDictionaryEntity;
import com.yzjs.localhost.service.tNeusoftResourceDictionary.TNeusoftResourceDictionaryService;




/**
 * 东软字典资源信息表
 *
 * @author yuqiumin
 * @email sunlightcs@gmail.com
 * @date 2021-09-02 10:49:41
 */
@Api(tags = "东软字典资源信息表")
@RestController
@RequestMapping("tNeusoftResourceDictionary")
public class TNeusoftResourceDictionaryController {
    @Autowired
    private TNeusoftResourceDictionaryService tNeusoftResourceDictionaryService;




    /**
     * 信息
     */
    @ApiOperation(value="信息" ,httpMethod =RequestMethod.GET )
    @RequestMapping("/info")
    public TNeusoftResourceDictionaryEntity info( @RequestParam(required = true)   Integer id){
        TNeusoftResourceDictionaryEntity  query = new TNeusoftResourceDictionaryEntity();
        query.setId(id);
        TNeusoftResourceDictionaryEntity tNeusoftResourceDictionary = tNeusoftResourceDictionaryService.findOne(query);
        return  tNeusoftResourceDictionary ;
    }
    /**
    * 列表查询
    * @return
    */
    @ApiOperation(value="列表查询" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/list")
    public List<TNeusoftResourceDictionaryEntity> List( @RequestBody TNeusoftResourceDictionaryEntity tNeusoftResourceDictionary) {

        List<TNeusoftResourceDictionaryEntity> tNeusoftResourceDictionarys = tNeusoftResourceDictionaryService.findList(tNeusoftResourceDictionary);
        return tNeusoftResourceDictionarys;
    }


    /**
     * 分页查询
     * @param tNeusoftResourceDictionary
     * @return
     */
    @ApiOperation(value="分页查询" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/listPage")
    public PageInfo<TNeusoftResourceDictionaryEntity> listPage(@RequestBody TNeusoftResourceDictionaryEntity tNeusoftResourceDictionary) {
        List<TNeusoftResourceDictionaryEntity> tNeusoftResourceDictionarys  = tNeusoftResourceDictionaryService.findList(tNeusoftResourceDictionary);
        return new PageInfo<>(tNeusoftResourceDictionarys ,tNeusoftResourceDictionary);
    }


    /**
     * 保存
     */
    @ApiOperation(value="保存" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/save")
    public TNeusoftResourceDictionaryEntity save(@RequestBody TNeusoftResourceDictionaryEntity tNeusoftResourceDictionary){
		tNeusoftResourceDictionaryService.insert(tNeusoftResourceDictionary);
        return tNeusoftResourceDictionary;
    }

    /**
     * 修改
     */
    @ApiOperation(value="修改" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/update")
    public TNeusoftResourceDictionaryEntity update(@RequestBody TNeusoftResourceDictionaryEntity tNeusoftResourceDictionary){
		tNeusoftResourceDictionaryService.update(tNeusoftResourceDictionary);
        return tNeusoftResourceDictionary;
    }

    /**
     * 删除
     */
    @ApiOperation(value="删除" ,httpMethod =RequestMethod.DELETE )
    @RequestMapping("/delete")
    public TNeusoftResourceDictionaryEntity  delete( @RequestParam(required = true)  Integer id){
        TNeusoftResourceDictionaryEntity  delete  = new TNeusoftResourceDictionaryEntity();
        delete.setId(id);
        tNeusoftResourceDictionaryService.delete(delete);
        return delete;
    }

}
